package com.iven.xie.controller;

import com.iven.xie.fegin.HelloRemoteFegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 基于Feign使用Hystrix
 *
 * @author iven.xie
 */
@RestController
@RequestMapping("/api")
public class HelloController {

    //@Qualifier("com.iven.xie.fegin.HelloRemote")
    @Autowired
    HelloRemoteFegin helloRemoteFegin;

    @RequestMapping("/hello/{name}")
    public String index(@PathVariable("name") String name) {
        return helloRemoteFegin.hello(name);
    }

}